import Bill from './bill';
import Detail from './detail';
import Total from './total';
import BillManege from './index';
import { Redirect } from 'react-router-dom';

// function BillRote(){
    const billArr = [
        {
            menuId: 1,
            path: '/home/billManege',
            component: BillManege,
            name: '账单管理',
            children: [
                
                {
                    menuId: 2,
                    path: '/home/billManege/bill',
                    component: Bill,
                    name: '对账单',
                },
                {
                    menuId: 3,
                    path: '/home/billManege/detail',
                    component: Detail,
                    name: '账单明细',
                },
                {
                    menuId: 4,
                    path: '/home/billManege/total',
                    component: Total,
                    name: '提成结算',
                },
            ]
            // Redirect
        }
    ]
  
    // return (
    //     <BrowserRouter>
    //         <Switch>
    //             {
    //                 billArr.map((item, index)=>{
    //                     if(item.children.length){
    //                         return item.children.map((item2,indey)=>{
    //                             return <Route key={indey} path={item2.path}>{item2.component}</Route>
    //                         })
    //                     }else {
    //                         return <Route path={item.path}>{item.component}</Route>
    //                     }
    //                 })
    //             }
    //             <Redirect to="/home/billManege/bill"><BillManege /></Redirect>
    //         </Switch>

    //     </BrowserRouter>
    // )

// }
// export default BillRote;
// export default billArr;
export {
    billArr
}